package org.mozhu.mboot.core;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * Wrap the application context, initialized in the spring context to get the
 * ApplicationContext statically
 * 
 * @see ApplicationContext
 */
public class ApplicationContextWrapper implements ApplicationContextAware {

	private static ApplicationContext applicationContext;

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		ApplicationContextWrapper.applicationContext = applicationContext;
	}

	public static ApplicationContext getContext() {
		return applicationContext;
	}
}
